import { createRouter, createWebHistory } from 'vue-router'
import Home from '@/views/Home.vue'
import Data from '@/views/Data.vue'
import Picture from '@/views/Picture.vue'
import AuthForm from '@/components/AuthForm.vue' // 新增
import HistoryPanel from '@/views/History.vue'

const routes = [
  { path: '/', redirect: '/login' },
  { path: '/login', component: AuthForm },
  { path: '/home', component: Home },
  { path: '/data', component: Data },
  { path: '/picture', component: Picture },
  { path: '/history', component: HistoryPanel }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router